package com.jinandi.app.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import com.jinandi.app.domain.AuthoritAndRes;

public interface AuthoritAndResDao extends JpaSpecificationExecutor<AuthoritAndRes>, JpaRepository<AuthoritAndRes, Integer> , PagingAndSortingRepository<AuthoritAndRes, Integer>{

	/**
	 * <根据角色ID删除角色和资源的关系>
	 * @param aid
	 * @author CGC 
	 * 创建日期:2013-5-9 下午1:33:38
	 */
	@Modifying
	@Query("delete from AuthoritAndRes ar where ar.authorit.id = ?1")
	@Transactional
	void deleteByAuthorit(Long aid);

}
